<template>
	<div style="">
		<iframe id="mapPage"  height="700px" frameborder=0
			src="https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=CFKBZ-VR63P-Z35DK-L4WJM-WQF2J-SGB52&referer=门店管理&policy=1">
		</iframe>
	</div>
</template>

<script>
	import {
		defineComponent,
		reactive,
		onMounted,
		ref
	} from 'vue'
	export default defineComponent({
		props:['address'],
		setup(props, ctx) {
			onMounted(() => {
				window.addEventListener('message', function(event) {
					// 接收位置信息，用户选择确认位置点后选点组件会触发该事件，回传用户的位置信息
					var loc = event.data;
					console.log('lob>>>>>>>>>>>>>>>>',JSON.stringify(loc))
					if (loc && loc.module =='locationPicker') { //防止其他应用也会向该页面post信息，需判断module是否为'locationPicker'
						console.log('location', loc);
						ctx.emit('update:Address',loc);
						
					}
				}, false);
			})
		}
	})
</script>

<style>
</style>
